home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / win / pascal / pnt_bmp.exe / TSTPAINT.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1991-05-03  |  1.9 KB  |  76 lines

  1. program TestPaint;
  2.  
  3. uses Strings, WinTypes, WinProcs, WinDos, WObjects, StdDlgs,
  4.      PaintBMP;
  5.  
  6. {$R TSTPAINT.RES}
  7.  
  8. const
  9.   cm_TestW = 201;
  10.  
  11. type
  12.   TMyApplication =
  13.     object(TApplication)
  14.       procedure InitMainWindow; virtual;
  15.     end;
  16.  
  17.  PMyWindow = ^TMyWindow;
  18.  TMyWindow =
  19.    object(TWindow)
  20.      TempWin: PWinBMP;
  21.  
  22.      constructor Init(AParent: PWindowsObject; ATitle: PChar);
  23.      destructor Done; virtual;
  24.      procedure TestWindow( var Msg: TMessage); virtual cm_First + cm_TestW;
  25.    end;
  26.  
  27. {--------------------------------------------------}
  28. { TMyWindow's method implementations:              }
  29. {--------------------------------------------------}
  30.  
  31. constructor TMyWindow.Init(AParent: PWindowsObject; ATitle: PChar);
  32. begin
  33.   TWindow.Init(AParent, ATitle);
  34.   Attr.Menu := LoadMenu( HInstance, 'TEST_MENU');
  35. end;
  36.  
  37. destructor TMyWindow.Done;
  38. begin
  39.   TWindow.Done;
  40. end;
  41.  
  42. procedure TMyWindow.TestWindow( var Msg: TMessage);
  43. begin
  44.   TempWin := New( PWinBMP, Init( @Self, 'Popup Window with Caption', 100, 100, 300, 300,
  45.                 (ws_PopupWindow or ws_Caption or ws_Visible)));
  46.   TempWin^.PaintBlank( 5, 5, 290, 35);
  47.   TempWin^.ShadowFrame( 5, 15, 290, 35);
  48.   TempWin^.ShadowHLine( 0, 299, 50);
  49.   TempWin^.ShadowVLine( 145, 52, 299);
  50. end;
  51.  
  52. {--------------------------------------------------}
  53. { TMyApplication's method implementations:         }
  54. {--------------------------------------------------}
  55.  
  56. procedure TMyApplication.InitMainWindow;
  57. begin
  58.   MainWindow := New(PMyWindow, Init(nil, 'TPW: Bitmap Painting'));
  59. end;
  60.  
  61. {--------------------------------------------------}
  62. { Main program:                                    }
  63. {--------------------------------------------------}
  64.  
  65. var
  66.   MyApp : TMyApplication;
  67.  
  68. begin
  69.   MyApp.Init('Skeleton');
  70.   MyApp.Run;
  71.   MyApp.Done;
  72. end.
  73.  
  74. {For more TPW routines, call Public (software) Library for a free newsletter.}
  75. {Call 800-242-4PsL or 713-524-6394.}
  76.